package com.heart.servicefeign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Feign服务访问控制器
 *
 * @author: heart
 * @date: 2018/6/15
 */
@RestController
public class FeignController {

    private static final String METHOD = "Feign";

    @Autowired
    private FeignService        feignService;

    @RequestMapping("/hello_method")
    public String sayHelloWithMethod(@RequestParam("name") String name) {
        return feignService.sayHelloFromEurekaClient(name, METHOD);
    }

    @RequestMapping("/hello")
    public String sayHello(@RequestParam("name") String name) {
        return feignService.sayHelloFromEurekaClient(name);
    }

}
